/**
 * Activity.java
 * Version: 1.0
 * Created in 06/08/2013
 * Created by: Gerson Groth
 * 
 * Copyright
 */
package activities.base.tcx;

import java.util.ArrayList;

/**
 * Cada Activity irá conter:<br>
 * <ul>
 * <li>tipo do esporte praticado</li>
 * <li>um ID (aparentemente sempre será representado pelo tempo de início do
 * exercício)</li>
 * <li>uma classe creator, que possui informações sobre o aparelho usado no
 * exercício</li>
 * <li>um array de voltas (as voltas são definidas pelo usuário, seja por tempo,
 * ou por distância)</li>
 * </ul>
 * .
 * 
 * @author Gerson Groth
 */
public class Activity {

	/** The sport type. */
	private SportType sportType;

	/** The laps. */
	private ArrayList<Lap> laps = new ArrayList<Lap>();

	/** The id. */
	private String id;

	/** The creator. */
	private Creator creator;

	/**
	 * Instantiates a new activity.
	 * 
	 * @param sportType
	 *            the sport type
	 * @param id
	 *            the id
	 * @param creator
	 *            the creator
	 */
	public Activity(SportType sportType, String id, Creator creator) {
		super();
		this.sportType = sportType;
		this.id = id;
		this.creator = creator;
	}

	/**
	 * Gets the sport type.
	 * 
	 * @return the sport type
	 */
	public SportType getSportType() {
		return sportType;
	}

	/**
	 * Sets the sport type.
	 * 
	 * @param sportType
	 *            the new sport type
	 */
	public void setSportType(SportType sportType) {
		this.sportType = sportType;
	}

	/**
	 * Gets the laps.
	 * 
	 * @return the laps
	 */
	public ArrayList<Lap> getLaps() {
		return laps;
	}

	/**
	 * Gets the lap.
	 * 
	 * @param index
	 *            the index
	 * @return the lap
	 */
	public Lap getLap(int index) {
		return this.laps.get(index);
	}

	/**
	 * Adds the laps.
	 * 
	 * @param laps
	 *            the laps
	 */
	public void addLaps(ArrayList<Lap> laps) {
		this.laps.addAll(laps);
	}

	/**
	 * Adds the lap.
	 * 
	 * @param lap
	 *            the lap
	 */
	public void addLap(Lap lap) {
		this.laps.add(lap);
	}

	/**
	 * Gets the id.
	 * 
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * Sets the id.
	 * 
	 * @param id
	 *            the new id
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * Gets the creator.
	 * 
	 * @return the creator
	 */
	public Creator getCreator() {
		return creator;
	}

	/**
	 * Sets the creator.
	 * 
	 * @param creator
	 *            the new creator
	 */
	public void setCreator(Creator creator) {
		this.creator = creator;
	}

	/**
	 * Size.
	 * 
	 * @return the number of laps
	 */
	public int size() {
		return this.laps.size();
	}

}
